<?php
	include_once($_SERVER['DOCUMENT_ROOT']."/Games/Plugins/_config_bring.php");

	/* Adds the fields to the end of the write sql so that they can be added*/
	function bring_write($p){
		for($i = 1; $i <= $_BRING_NUM; $i++){
			if($p['bring'.$i.'item']){
				$item = $p['bring'.$i.'item'];
				$output .= ",'$item'"
			}else{
				$output .=",''";
			}
			
			if($p['bring'.$i.'num']){
				$inum = $p['bring'.$i.'num'];
				$output .= ",'$num'"
			}else{
				$output .= ",0";
			}
		}
	}

	/* Displays the bring fields in the form used to write to the database */
	function bring_form_write(){

		/*  Repeat for each bring item */
		for($i = 1; $i <= $_BRING_NUM; $i++){
		$output  .= <<<ADMIN_FORM

	      <label for="bring{$i}item">Title:</label>
	      <input name="bring{$i}item" id="title" type="text" maxlength="150" />
	      <label for="bring{$i}num">Body Text:</label>
	      <textarea name="bring{$i}num" id="bodytext"></textarea>
	      
ADMIN_FORM;		
		}
		return output;
	}

?>